import { TreeData } from './tree-data';
import { SnippetsDataModel } from './tree-data';
import { TreeViewService } from './treeview.service';

let mockSnippets: SnippetsDataModel = {
    id: 1,
    name: "根目录",
    children: [
      {
        id: 2,
        name: "子目录1",
        children: [
          {
            id: 3,
            name: "Dire3",
          },
        ],
        snippets: [1, 2, 3, 4]
      },
      {
        id: 50,
        name: "子目录2",
        snippets: [1, 2, 3, 4]
      },
      {
        id: 60,
        name: "其他",
        snippets: [1, 2, 3, 4]
      }
    ]
  }

export class SnippetsData {
  static init(treeviewService: TreeViewService) {
    let initTreeData = new TreeData(mockSnippets);
    treeviewService.treeData.next(initTreeData);
    treeviewService.changeSelection(initTreeData.id);
  }
}
